import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import Start from '../components/Start.vue'
import Login from '../components/Login.vue'
import Index from '../components/Index/Index.vue'
import Recommended from '../components/Index/Recommended.vue'
import MusicLibrary from '../components/Index/MusicLibrary.vue'
import Opera from '../components/Index/Opera.vue'
import Room from '../components/Index/Room/Room.vue'
import CreateRoom from '../components/Index/Room/CreateRoom.vue'
import GoRoom from '../components/Index/Room/GoRoom.vue'
import RoomClassification from '../components/Index/Room/RoomClassification.vue'
import RoomPermissions from '../components/Index/Room/RoomPermissions.vue'
import LeaveMessage from '../components/Index/Room/GoRoom/LeaveMessage.vue'
import RoomIndex from '../components/Index/Room/GoRoom/RoomIndex.vue'
import RowWheat from '../components/Index/Room/GoRoom/RowWheat.vue'
import Focus from '../components/Index/Room/Focus.vue'
import FocusAdd from '../components/Index/Room/FocusAdd.vue'
import Dynamic from '../components/Dynamic/Dynamic.vue'
import Music from '../components/Music/Music.vue'
import Message from '../components/Message/Message.vue'
import My from '../components/My/My.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', component: Start },
    { path: '/login', component: Login },
    // 进入 home 页面
    {
      path: '/home',
      component: Home,
      redirect: '/index',
      children: [
        // 首页
        {
          path: '/index',
          component: Index,
          redirect: '/index/recommended',
          children: [
            // 推荐页
            { path: '/index/recommended', component: Recommended },
            // 音乐库页
            { path: '/index/library', component: MusicLibrary },
            // 戏曲页
            { path: '/index/opera', component: Opera },
            // 歌房页
            { path: '/index/room', component: Room }
          ]
        },
        // 动态页
        { path: '/dynamic', component: Dynamic },
        // 消息页
        { path: '/message', component: Message },
        // 听歌页
        { path: '/music', component: Music },
        // 个人信息页
        { path: '/my', component: My }
      ]
    },
    // 创建房间页
    { path: '/index/room/createroom', component: CreateRoom },
    // 房间分类页
    { path: '/index/room/createroom/roomclassification', component: RoomClassification },
    // 房间权限页
    { path: '/index/room/createroom/roompermissions', component: RoomPermissions },
    // （进入）房间页
    { path: '/index/room/goroom', component: GoRoom },
    // 给房主留言页
    { path: '/index/room/goroom/leavemessage', component: LeaveMessage },
    // 房主主页
    { path: '/index/room/goroom/roomindex', component: RoomIndex },
    // 排麦页
    { path: '/index/room/goroom/rowwheat', component: RowWheat },
    // 我的关注页
    { path: '/index/room/Focus', component: Focus },
    // 添加关注页
    { path: '/index/room/Focus/FocusAdd', component: FocusAdd }
  ]
})

export default router
